package com.hhkj.admin.order.common.cont;

import com.ruoyi.common.exception.GlobalException;
import lombok.AllArgsConstructor;
import lombok.Getter;

public class OrderRefundConst {

    @AllArgsConstructor
    @Getter
    public enum StatusEnum {

        NON("无退款", "non"),

        REFUNDING("退款中", "refunding"),

        SUCCESS("退款成功", "success"),

        FAILED("退款失败", "failed"),

        CANCEL("已取消", "cancel");

        private String name;

        private String code;

        public static String getNameByCode(String code) {
            for (StatusEnum value : StatusEnum.values()) {
                if (value.code.equals(code)) {
                    return value.name;
                }
            }
            throw new GlobalException("找不到对应的code，请联系管理员");
        }
    }

    @AllArgsConstructor
    @Getter
    public enum PayoutStatusCode {

        NON("无退款", "non"),

        PENDING("待打款", "pending"),

        DONE("已打款", "done");

        private String name;

        private String code;
    }
}
